home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / mamedbg.h < prev    next >
C/C++ Source or Header  |  2000-04-23  |  3KB  |  103 lines

  1. #ifndef _MAMEDBG_H
  2. #define _MAMEDBG_H
  3.  
  4. #include "mame.h"
  5.  
  6. #ifndef DECL_SPEC
  7. #define DECL_SPEC
  8. #endif
  9.  
  10. #ifdef MAME_DEBUG
  11.  
  12. #define COLOR_TITLE         YELLOW
  13. #define COLOR_FRAME         LIGHTCYAN
  14. #define COLOR_REGS            WHITE
  15. #define COLOR_DASM          WHITE
  16. #define COLOR_MEM1          WHITE
  17. #define COLOR_MEM2          WHITE
  18. #define COLOR_CMDS            WHITE
  19. #define COLOR_BRK_EXEC        YELLOW
  20. #define COLOR_BRK_DATA        (YELLOW+BLUE*16)
  21. #define COLOR_BRK_REGS        (YELLOW+BLUE*16)
  22. #define COLOR_ERROR         (YELLOW+RED*16)
  23. #define COLOR_HELP            (WHITE+BLUE*16)
  24. #define COLOR_PROMPT        CYAN
  25. #define COLOR_CHANGES       LIGHTCYAN
  26. #define COLOR_PC            (WHITE+BLUE*16) /* MB 980103 */
  27. #define COLOR_CURSOR        (WHITE+RED*16)    /* MB 980103 */
  28.  
  29. /***************************************************************************
  30.  *
  31.  * The following functions are defined in mamedbg.c
  32.  *
  33.  ***************************************************************************/
  34. /* What EA address to set with debug_ea_info (origin) */
  35. enum {
  36.     EA_DST,
  37.     EA_SRC
  38. };
  39.  
  40. /* Size of the data element accessed (or the immediate value) */
  41. enum {
  42.     EA_DEFAULT,
  43.     EA_INT8,
  44.     EA_UINT8,
  45.     EA_INT16,
  46.     EA_UINT16,
  47.     EA_INT32,
  48.     EA_UINT32,
  49.     EA_SIZE
  50. };
  51.  
  52. /* Access modes for effective addresses to debug_ea_info */
  53. enum {
  54.     EA_NONE,        /* no EA mode */
  55.     EA_VALUE,       /* immediate value */
  56.     EA_ABS_PC,      /* change PC absolute (JMP or CALL type opcodes) */
  57.     EA_REL_PC,      /* change PC relative (BRA or JR type opcodes) */
  58.     EA_ZPG_RD,        /* read zero page memory */
  59.     EA_ZPG_WR,        /* write zero page memory */
  60.     EA_ZPG_RDWR,    /* read then write zero page memory */
  61.     EA_MEM_RD,      /* read memory */
  62.     EA_MEM_WR,      /* write memory */
  63.     EA_MEM_RDWR,    /* read then write memory */
  64.     EA_PORT_RD,     /* read i/o port */
  65.     EA_PORT_WR,     /* write i/o port */
  66.     EA_COUNT
  67. };
  68.  
  69. /***************************************************************************
  70.  * This function can (should) be called by a disassembler to set
  71.  * information for the debugger. It sets the address, size and type
  72.  * of a memory or port access, an absolute or relative branch or
  73.  * an immediate value and at the same time returns a string that
  74.  * contains a literal hex string for that address.
  75.  * Later it could also return a symbol for that address and access.
  76.  ***************************************************************************/
  77. extern const char *set_ea_info( int what, unsigned address, int size, int access );
  78.  
  79. /* Startup and shutdown functions; called from cpu_run */
  80. extern void mame_debug_init(void);
  81. extern void mame_debug_exit(void);
  82.  
  83. /* If this flag is set, a CPU core should call MAME_Debug from it's execution loop */
  84. extern int mame_debug;
  85.  
  86. /* This is the main entry into the mame debugger */
  87. extern void MAME_Debug(void);
  88.  
  89. /***************************************************************************
  90.  * Convenience macro for the CPU cores, this is defined to empty
  91.  * if MAME_DEBUG is not specified, so a CPU core can simply add
  92.  * CALL_MAME_DEBUG; before executing an instruction
  93.  ***************************************************************************/
  94. #define CALL_MAME_DEBUG if( mame_debug ) MAME_Debug()
  95.  
  96. #else   /* MAME_DEBUG */
  97.  
  98. #define CALL_MAME_DEBUG
  99.  
  100. #endif  /* !MAME_DEBUG */
  101.  
  102. #endif /* _MAMEDBG_H */
  103.